package com.cx.simpleweb.filter;


import com.cx.simpleweb.config.RepeatReadRequest;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.logging.LogRecord;

/**
 * @author cxx
 * @create 2021-01-14 15:59
 **/
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
public class FirstFilter implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        chain.doFilter (new RepeatReadRequest ((HttpServletRequest) request),response);
    }
}
